<?php

namespace App\Models\wechat;

use Illuminate\Database\Eloquent\Model;

class Order extends Model
{
    //
    protected $guarded = []; //黑名单

    //一个订单有一个订单地址
    public function address()
    {
        return $this->hasOne('App\Models\wechat\OrderAddress');
    }

    //一个订单有许多订单商品
    public function order_products()
    {
        return $this->hasMany('App\Models\wechat\OrderProduct');
    }

    //一个客户有多个订单
    public function customer()
    {
        return $this->belongsTo('App\Models\shop\Customer');
    }

    //快递
    public function express()
    {
        return $this->belongsTo('App\Models\shop\Express');
    }
}
